package Homework.apiDay05;

import java.io.FileOutputStream;
import java.io.IOException;

public class FinallyDemo {
    public static void main(String[] args) {
        FileOutputStream fos = null;
        try {
            fos = new FileOutputStream("test.txt");
            fos.write(225);
        }catch (IOException e){
            System.out.println("出现输入输出错误");
        }finally {
            if(fos!=null){
                try {
                    fos.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
